package com.jia.service;

import com.jia.dao.BooksMapper;
import com.jia.pojo.Books;

import java.util.List;

public class BooksServiceImpl implements BooksService {

    // Service 调用 Dao 组合Dao
    private BooksMapper booksMapper;

    public void setBooksMapper(BooksMapper booksMapper) {
        this.booksMapper = booksMapper;
    }

    public int addBook(Books books) {
        return booksMapper.addBook(books);
    }

    public int deleteBook(int id) {
        return booksMapper.deleteBook(id);
    }

    public int updateBook(Books books) {
        return booksMapper.updateBook(books);
    }

    public Books queryBookById(int id) {
        return booksMapper.queryBookById(id);
    }

    public List<Books> queryAllBooks() {
        return booksMapper.queryAllBooks();
    }
}
